#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_CFLAGS_MAINT_APPEND  = -Wall -pedantic
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed

# Some variables:
DEB_HOST_ARCH_OS  ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
DEB_HOST_ARCH_CPU ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU)

DEB_BUILD_OPTIONS=noautodbgsym

%:
	dh $@ --with autoreconf --exclude=.la

override_dh_auto_configure:
	dh_auto_configure -- \
		--enable-tools=yes \
		--enable-bindings-python \
		$(NULL)

override_dh_clean:
	dh_clean
	find -name "lt~obsolete.m4" | xargs rm -rf
	find -name "ltversion.m4" | xargs rm -rf
	find -name "ltsugar.m4" | xargs rm -rf
	find -name "ltoptions.m4" | xargs rm -rf
	find -name "libtool.m4" | xargs rm -rf
	find -name "aclocal.m4" | xargs rm -rf
	rm -rf confdefs.h
	rm -rf autostuff
	rm -rf doc/*

override_dh_missing:
	dh_missing --fail-missing
